//
//  AppDelegate.h
//  RONGAO
//
//  Created by wei wang on 2017/2/21.
//  Copyright © 2017年 wei wang. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
#import "FLSideSlipViewController.h"
#import "VisitingMessageViewController.h"


#import "MyCamera.h"
#ifdef LIB_140210
#import "IOTCamera/IOTCAPIs.h"
#import "IOTCamera/RDTAPIs.h"
#else
#import "IOTCamera/IOTCAPIs.h"
#import "IOTCamera/RDTAPIs.h"
#endif


#import <DTCloudKit/DTCloudKit.h>

#define DONE 1
#define NOTDONE 0
#define LOOP_NUM 1
#define LOOP_USLEEP 3*1000*1000

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property Boolean isLoadOverDataBase;
@property Boolean isRunningConnectingThread;
@property Boolean isRunningStartingThread;
@property (nonatomic, strong) NSThread *startThread;
@property (nonatomic, strong) NSConditionLock *startThreadLock;
@property (nonatomic, strong) NSString *showViewUID;
@property (nonatomic, strong) NSThread *connectThread;
@property (nonatomic, strong) NSConditionLock *connectThreadLock;

@property (strong, nonatomic) UIWindow *window;

@property (readonly, strong) NSPersistentContainer *persistentContainer;

- (void)saveContext;

+ (AppDelegate *)globalDelegate;

/** 当前连接的Wi-Fi模型 **/
@property(nonatomic,strong) DTDevice *doorWiFiModel;
/** 当前cameraModel **/
@property(nonatomic,strong) MyCamera *cameraModel;

@property (nonatomic, strong) VisitingMessageViewController *visitingMessageViewController;

@property (retain, nonatomic) FLSideSlipViewController *menuViewController;
/** 当前门锁的Mac地址 */
@property (nonatomic ,copy)NSString *currentMac;

/** 数据库 **/
@property(nonatomic,strong) FMDatabase *database;

/** token **/
@property(nonatomic,strong) NSString *deviceTokenString;

/** 摄像头列表 **/
@property(nonatomic,strong) NSMutableArray *camera_list;

/** camera_uid_list **/
@property(nonatomic,strong) NSMutableArray *camera_uid_list;

/** isUIInterfaceOrientationMaskAllButUpsideDown **/
@property(nonatomic,assign) BOOL isUIInterfaceOrientationMaskAllButUpsideDown;;

/** <#Description#> **/
@property(nonatomic,assign) NSInteger indexView;


/** <#Description#> **/
@property(nonatomic,assign) BOOL isShowAlarmTipView;
@property(nonatomic,assign) BOOL isEnableShowAlarmTipView;

@property(nonatomic,assign) BOOL isShowVisitingMessageViewC;

+ (NSString *) pathForDocumentsResource:(NSString *) relativePath;

- (void)loopConnect;
- (void)disLoopConnect;

- (void)loopStart;
- (void)disLoopStart;

- (NSMutableArray *)loadDeviceFromDatabase:(NSString *)indexView;

- (void)loadDeviceFromDatabase;




@end

